package com.xwh.b2c.handlers;

public class BaseContextHandler {
    private static ThreadLocal<Long> context = new ThreadLocal<Long>();

    //将userId传入线程变量，在请求的任何时候都可以获取到UserId
    public static void set(Long userId) {
        context.set(userId);
    }

    public static Long get() {
        return context.get();
    }

    public static void remove() {
        context.remove();
    }
}